﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Tea.CConverter {
    public class CConverter :Tea.Parser.IAstVisitor {

        StringBuilder _buffer = new StringBuilder();

        public override string ToString() {
            return _buffer.ToString();
        }

        public void VisitArrayLiteral(Parser.ArrayLiteral arrayLiteral) {
            
        }

        public void VisitAssignmentExpression(Parser.AssignmentExpression assignmentExpression) {
            
        }

        public void VisitBlock(Parser.Block blockStatement) {
            foreach (Tea.Parser.Statement s in blockStatement.Statements) {
                s.Accept(this);
            }
        }

        public void VisitBreakStatement(Parser.BreakStatement breakStatement) {
            
        }

        public void VisitCallNative(Parser.CallNative callNative) {
            
        }

        public void VisitCaseClause(Parser.CaseClause caseLabel) {
            
        }

        public void VisitConditionalExpression(Parser.ConditionalExpression conditionalExpression) {
            
        }

        public void VisitContinueStatement(Parser.ContinueStatement continueStatement) {
            
        }

        public void VisitPostfixExpression(Parser.PostfixExpression countOperation) {
            
        }

        public void VisitConstStatement(Parser.ConstStatement constStatement) {
            
        }

        public void VisitDebuggerStatement(Parser.DebuggerStatement debuggerStatement) {
            
        }

        public void VisitDoWhileStatement(Parser.DoWhileStatement doWhileStatement) {
            
        }

        public void VisitEmptyStatement(Parser.EmptyStatement emptyStatement) {
            
        }

        public void VisitExpressionStatement(Parser.ExpressionStatement expressionStatement) {
            expressionStatement.Expression.Accept(this);
        }

        public void VisitFalseLiteral(Parser.FalseLiteral falseLiteral) {
            _buffer.Append("0");
        }

        public void VisitForInStatement(Parser.ForInStatement forinStatement) {
            
        }

        public void VisitForStatement(Parser.ForStatement forStatement) {
            
        }

        public void VisitFunctionExpression(Parser.FunctionExpression functionExpression) {
            
        }

        public void VisitFunctionCallExpression(Parser.FunctionCallExpression functionCallExpression) {
            
        }

        public void VisitFunctionDeclaration(Parser.FunctionDeclaration functionDeclaration) {
            
        }

        public void VisitLabelledStatement(Parser.LabelledStatement labelledStatement) {
            
        }

        public void VisitNewExpression(Parser.NewExpression newExpression) {
            
        }

        public void VisitNumberLiteral(Parser.NumberLiteral numberLiteral) {
            _buffer.Append(numberLiteral.Value);
        }

        public void VisitNullLiteral(Parser.NullLiteral nullLiteral) {
            _buffer.Append("0");
        }

        public void VisitIdentifier(Parser.Identifier identifier) {
            
        }

        public void VisitIndexCallExpression(Parser.IndexCallExpression indexCallExpression) {
            
        }

        public void VisitIfStatement(Parser.IfStatement ifStatement) {
            
        }

        public void VisitIncrementOperation(Parser.IncrementOperation incrementOperation) {
            
        }

        public void VisitObjectLiteral(Parser.ObjectLiteral objectLiteral) {
            
        }

        public void VisitParamedExpression(Parser.ParamedExpression paramedExpression) {
            
        }

        public void VisitProperty(Parser.ObjectLiteral.Property property) {
            
        }

        public void VisitPropertyCallExpression(Parser.PropertyCallExpression propertyCallExpression) {
            
        }

        public void VisitRegExpLiteral(Parser.RegExpLiteral regExpLiteral) {
            
        }

        public void VisitReturnStatement(Parser.ReturnStatement returnStatement) {
            
        }

        public void VisitSemicolon(Parser.Semicolon semicolon) {
            
        }

        public void VisitStringLiteral(Parser.StringLiteral stringLiteral) {
            
        }

        public void VisitSwitchStatement(Parser.SwitchStatement switchStatement) {
            
        }

        public void VisitThisLiteral(Parser.ThisLiteral thisLiteral) {
            
        }

        public void VisitThrowStatement(Parser.ThrowStatement throwStatement) {
            
        }

        public void VisitTrueLiteral(Parser.TrueLiteral trueLiteral) {
            
        }

        public void VisitTryCatchFinallyStatement(Parser.TryCatchFinallyStatement tryCatchFinallyStatement) {
            
        }

        public void VisitTryCatchStatement(Parser.TryCatchStatement tryCatchStatement) {
            
        }

        public void VisitTryFinallyStatement(Parser.TryFinallyStatement tryFinallyStatement) {
            
        }

        public void VisitUndefinedExpression(Parser.UndefinedExpression undefinedExpression) {
            
        }

        public void VisitUnaryExpression(Parser.UnaryExpression unaryExpression) {
            
        }

        public void VisitVariableDeclaration(Parser.VariableDeclaration variableDeclaration) {
            
        }

        public void VisitVariableStatement(Parser.VariableStatement variableStatement) {
            
        }

        public void VisitWhileStatement(Parser.WhileStatement whileStatement) {
            
        }

        public void VisitWithStatement(Parser.WithStatement withStatement) {
            
        }

        public void VisitAdditiveExpression(Parser.AdditiveExpression additiveExpression) {
            additiveExpression.Left.Accept(this);
            _buffer.Append("+");
            additiveExpression.Right.Accept(this);
        }

        public void VisitMultiplicativeExpression(Parser.MultiplicativeExpression multiplicativeExpression) {
            
        }

        public void VisitShiftExpression(Parser.ShiftExpression shiftExpression) {
            
        }

        public void VisitRelationalExpression(Parser.RelationalExpression relationalExpression) {
            
        }

        public void VisitEqualityExpression(Parser.EqualityExpression equalityExpression) {
            
        }

        public void VisitBitwiseExpression(Parser.BitwiseExpression bitwiseExpression) {
            
        }

        public void VisitLogicalExpression(Parser.LogicalExpression logicalExpression) {
            
        }

        public void VisitCommaExpression(Parser.CommaExpression commaExpression) {
            
        }

        public void VisitUserDefinedOperatorExpression(Parser.UserDefinedOperatorExpression userDefinedOperatorExpression) {
            
        }

        public void VisitModule(Parser.Module module) {
            VisitBlock(module);
        }
    }
}
